import request from "@/request/api";
//-------------------派工信息-------------------
/* 派工信息 */
//获取派工信息
export function getDispatchApi(data) {
  return request({
    url: "/eam-service-order/orderCommon/dispatch/queryDispatchInfoByOrderId",
    method: "get",
    params: data,
  });
}
//保存派工信息
export function saveDispatchApi(data, orderType) {
  return request({
    url: "/eam-service-order/orderCommon/dispatch/saveDispatchInfo",
    method: "post",
    params: {
      orderType
    },
    data: data,
  });
}
/* 权限接口 */
export function getOrderDictionApi(data) {
  return request({
    url: "/eam-service-order/order/getOrderJurisdiction",
    method: "get",
    params: data,
  });
}
//-------------------工单执行perform-------------------
/* 执行信息 */

//执行信息列表
export function performListApi(data) {
  return request({
    url: "/eam-service-order/orderCommon/execute/queryExecuteInfoByOrderId",
    method: "get",
    params: data,
  });
}

//新增\保存执行信息
export function performInsertApi(data, orderType) {
  return request({
    url: "/eam-service-order/orderCommon/execute/saveExecuteInfo",
    method: "post",
    params: {
      orderType
    },
    data: data,
  });
}
//查询执行信息详情
export function performDetailsApi(executeId = "") {
  return request({
    url: "/eam-service-order/orderCommon/execute/queryExecuteInfoByExecuteId",
    method: "get",
    params: {
      executeId
    },
  });
}

//查询可提交的人员列表
export function getSubmitUserApi(orderId = "") {
  return request({
    url: "/eam-service-order/orderCommon/querySubmitUserListByOrderId",
    method: "get",
    params: {
      orderId
    },
  });
}
//根据工单执行id删除
export function performDeleteApi(data) {
  return request({
    url: "/eam-service-order/orderCommon/execute/deleteExecuteInfoByExecuteId",
    method: "delete",
    params: data,
  });
}

/* 验收信息 */
//-------------------工单验收-------------------
//工单验收列表
export function acceptListApi(data) {
  return request({
    url: "/eam-service-order/orderAccept/queryList",
    method: "get",
    params: data,
  });
}
//查询工单验收详情
export function acceptDetailsApi(id = "") {
  return request({
    url: "/eam-service-order/orderAccept/queryById",
    method: "get",
    params: {
      id
    },
  });
}
//查询工单验收详情
export function acceptDetailsOrder(orderId = "") {
  return request({
    url: "/eam-service-order/orderAccept/queryByOrderId",
    method: "get",
    params: {
      orderId
    },
  });
}

//删除单个工单验收
export function acceptDeleteApi(data) {
  return request({
    url: "/eam-service-order/orderAccept/deleteById",
    method: "delete",
    params: data,
  });
}
//新增工单验收\更新工单验收
export function acceptUpdateApi(data, orderType) {
  return request({
    url: "/eam-service-order/orderCommon/saveAcceptInfo",
    method: "post",
    params: {
      orderType
    },
    data: data,
  });
}
//工单关联设备查询接口
export function queryEquipsByOrderId(data) {
  return request({
    url: "/eam-service-order/orderEquipment/queryList",
    method: "get",
    params: data,
  });
}
//根据工单id查询关联的工作票
export function queryTicketByOrderId(orderId = "") {
  return request({
    url: "/eam-service-order/overhaul/ticket/queryTicketByOrderId",
    method: "get",
    params: {
      orderId
    },
  });
}
//根据工单id查询关联的工作票
export function queryTicketListApi(orderId = "") {
  return request({
    url: "/eam-service-order/overhaul/ticket/queryTicketListByOrderId",
    method: "get",
    params: {
      orderId
    },
  });
}